home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 32 / cadence.zip / VOL1NO1.ZIP / PCIRCLE.LSP < prev   
Text File  |  1986-06-10  |  1KB  |  35 lines

  1. ;**********************************************************************
  2. ;                    AUTOCAD COMMAND PCIRLCE
  3. ;  Simplifies the use of Pline to draw 'doughnuts' and filled circles.
  4. ;  User specifies circle by center and radius. Width of pline is
  5. ;  specified by a width or by an inner radius. If user presses ENTER
  6. ;  instead of entering an inner radius, a solid circle is drawn.
  7. ;        K. Funk           Version 1.0           April 23,1986.
  8. ;**********************************************************************
  9.  
  10. (setvar "CMDECHO" 0)
  11.  
  12. ;FUNCTION *error* - action to take on lisp error.
  13. (defun *error* (st)
  14.    (princ "error: ")
  15.    (princ st)
  16.    (terpri)
  17. ) ; END of *error*
  18.  
  19.  defun C:PCIRCLE ()
  20.    (setq Cen nil OutR nil InR nil Width nil)
  21.    (While (NULL Cen) (setq Cen (getpoint "\nCenter of Circle: ")))
  22.    (While (NULL OutR) (setq OutR (getdist Cen "\nRadius: ")))
  23.    (setq Width (getreal "\nLine Width or Enter for Radius: "))
  24.    (cond ((NOT (NULL Width))
  25.             (setq InR (- OutR Width)))
  26.          (T
  27.             (setq InR (getdist Cen "\nInner Radius or Enter for Solid: "))
  28.             (If (NULL InR) (setq InR 0.0))
  29.             (setq Width (- OutR InR)))
  30.    ) ;end cond
  31.    (setq Start (list (+ (car Cen) (/ (+ InR OutR) 2.0)) (cadr Cen)))
  32.    (Command "Pline" Start "W" Width "" "Arc" "CE" Cen "Angle" "180" "Close")
  33. ) ;END of PCIRCLE
  34.  
  35.